/*
 * @Description: 农业设施管理接口
 */
import xjaxios from "@/api/axios";

export default {
  /**
   * @description: 获取设备名称列表 *代表必填
   * @param {String/Number} page *
   * @param {String/Number} size *
   * @param {Object} entity {componyId: 1} *
   * @param {String} order 排序方式 ASC DESC 默认ASC
   * @param {String} sort 自定义排序方式 'createTime'
   * @return {Array}
   */
  // 分页查询获取列表信息
  getPageList(params) {
    return xjaxios.post("/farmEquipment/queryPageList", {
      page: params.page,
      size: params.size,
      sort: "timestamp",
      order: "DESC",
      entity: {
        organizationNo: sessionStorage.organizationNo
      }
    });
  },
  /**
   * @description: 添加add,删除delList,修改成本信息edit
   * @param {Object} params *
   * @return {Object}
   */
  allmetInfo(params, met) {
    params.organizationNo = sessionStorage.organizationNo;
    return xjaxios.post(`/farmEquipment/${met}`, params);
  },
  /**
   * @description: 批量查询投入类型
   * @return {Object}
   */
  getallinpjuttype() {
    return xjaxios.get("/inputType/queryList");
  },
  /**
   * @description: 主键查询设施名称
   * @param {Object} params *
   * @return {Object}
   */
  seachInfo(params) {
    return xjaxios.post("/farmEquipment/queryPageList", {
      page: params.page,
      size: params.size,
      sort: "timestamp",
      order: "DESC",
      entity: {
        equipmentNameLike: params.entity.equipmentName,
        organizationNo: sessionStorage.organizationNo
      }
    });
  }
};
